import React from 'react'
import { Switch,Route,NavLink,Redirect } from 'react-router-dom'
import "./index.css"
import Home from '../Home/Home'
import Cate from '../Cate/Cate'
import Mine from '../Mine/Mine'
import Shop from '../Shop/Shop'
const Index = () => {
    return (
        <div>
        <Switch>
            <Route path="/index/home"  component={Home}></Route>
            <Route path="/index/cate" component={Cate}></Route>
            <Route path="/index/shop" component={Shop}></Route>
            <Route path="/index/mine" component={Mine}></Route>
            <Redirect to="/index/home"></Redirect>
        </Switch>

        <footer className="index-navs">
            <NavLink to="/index/home" activeStyle={{ color: 'orange' }}>首页</NavLink>
            <NavLink to="/index/cate" activeStyle={{ color: 'orange' }}>分类</NavLink>
            <NavLink to="/index/shop" activeStyle={{ color: 'orange' }}>购物车</NavLink>
            <NavLink to="/index/mine" activeStyle={{ color: 'orange' }}>我的</NavLink>
        </footer>
    </div>
    )
}

export default Index
